<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>登录</title>
<script src="${rootpath}/BJUI/js/jquery-1.7.2.min.js"></script>
<script src="${rootpath}/BJUI/pm/md5.js" type="text/javascript"></script>
<link href="${rootpath}/BJUI/themes/css/bootstrap.min.css" rel="stylesheet">
<style type="text/css">
* {font-family: "Verdana", "Tahoma", "Lucida Grande", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;}
body {
    background: url(${rootpath}/BJUI/images/loginbg_01.jpg) no-repeat center center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
}
a:link {color: #285e8e;}
.main_box {
    position: absolute; top:50%; left:50%; margin-top:-260px; margin-left: -300px; padding: 30px; width:600px; height:460px;
    background: #FAFAFA; background: rgba(255,255,255,0.5); border: 1px #DDD solid;
    border-radius: 5px;
    -webkit-box-shadow: 1px 5px 8px #888888; -moz-box-shadow: 1px 5px 8px #888888; box-shadow: 1px 5px 8px #888888;
}
.main_box .setting {position: absolute; top: 5px; right: 10px; width: 10px; height: 10px;}
.main_box .setting a {color: #FF6600;}
.main_box .setting a:hover {color: #555;}
.login_logo {margin-bottom: 20px; height: 45px; text-align: center;}
.login_logo img {height: 45px;}
.login_msg {text-align: center; font-size: 16px;}
.login_form {padding-top: 20px; font-size: 16px;}
.login_box .form-control {display: inline-block; *display: inline; zoom: 1; width: auto; font-size: 18px;}
.login_box .form-control.x319 {width: 319px;}
.login_box .form-control.x164 {width: 164px;}
.login_box .form-group {margin-bottom: 20px;}
.login_box .form-group label.t {width: 120px; text-align: right; cursor: pointer;}
.login_box .form-group.space {padding-top: 15px; border-top: 1px #FFF dotted;}
.login_box .form-group img {margin-top: 1px; height: 32px; vertical-align: top;}
.login_box .m {cursor: pointer;}
.bottom {text-align: center; font-size: 12px;}

.destroy{position:fixed;top:0px;left:50%;margin-left:-425px;*margin-left:-718px;_margin-left:-425px;margin-top:-292px;z-index:99996;opacity:0;filter:alpha(opacity=0);}
.sheet{position:relative;width:850px;height:90px;margin:auto;padding:0;background:#fff9e2 url("${rootpath}/BJUI/images/tips_bg.gif");
	box-shadow:inset 0 -1px 0 #FFF,0 1px 6px rgba(0,0,0,.3);
	-moz-box-shadow:inset 0 -1px 0 #FFF,0 1px 6px rgba(0,0,0,.3);
	-webkit-box-shadow:inset 0 -1px 0 #FFF,0 1px 6px rgba(0,0,0,.3);
	
	border-bottom:2px solid #efebda;
	border-bottom-left-radius:5px;
	border-bottom-right-radius:5px;
	-moz-border-bottom-left-radius:5px;
	-moz-border-bottom-right-radius:5px;
	-webkit-border-bottom-left-radius:5px;
	-webkit-border-bottom-right-radius:5px;
}
.sheet a.close{display:block;position:absolute;width:20px;height:20px;right:5px;top:5px;background:url("${rootpath}/BJUI/images/sheet_close.gif") no-repeat;}
.sheet a:hover.close{background-position:0 -30px;}
.sheet a:active.close{background-position:0 -60px;}
.sheet .head{padding:20px 15px;}
.sheet .head h2{padding:0;font-size:18px;font-weight:400;color:red;text-align:center;}
</style>
<script type="text/javascript">
$(function() {
    //choose_bg();
	changeCode();
	//$("#j_username").focus();

	$("#captcha_img").click(function(){
		changeCode();
		$("#j_username").focus();
	});
	$("#login_form").submit(function(){
		var issubmit = true;
		var i_index  = 0;
		$(this).find('.in').each(function(i){
			if ($.trim($(this).val()).length == 0) {
				$(this).css('border', '1px #ff0000 solid');
				issubmit = false;
				if (i_index == 0)
					i_index  = i;
			}
		});
		if (!issubmit) {
			$(this).find('.in').eq(i_index).focus();
			return false;
		}
		var username = $("#j_username").val();
		var userpassword = md5($("#j_password").val());
		var captcha = $("#j_captcha").val();
		var randomKey = $("#j_randomKey").val();
		var remember = "";
		if ($("#j_remember").attr('checked')) {
			remember = "7";
		}
		$("#login_ok").attr("disabled", true).val('登陆中..');
		//调用ajax
		$.post("logincheck",
				{
			username:username,
    		userpassword:userpassword,
    		captcha:captcha,
    		remember:remember,
    		t:randomKey
    		},
    		function(data,status){
    			if(status!="success"){
    				//alert("登录提交失败！");
    				tip("登录提交失败！");
    			}else{
    				if(data.statusCode!="200"){
    					//alert(data.message);
    					tip(data.message);
    				}else{
    					window.location.href="${rootpath}/Index/main";
    					return;
    				}
    			}
    			$("#login_ok").attr("disabled", false).val('登陆');
    			$("#j_username").focus();
    			changeCode();
    			});
		
		
		
        return false;
	});
	
	$(".close").click(function(){
		$(".destroy").stop(true).animate({'margin-top':'-292px','opacity':'0'},800);
	});
	
	$('#j_username').bind('input propertychange', function() {
		$(".destroy").stop(true).animate({'margin-top':'-292px','opacity':'0'},800);
	});
	$('#j_password').bind('input propertychange', function() {
		$(".destroy").stop(true).animate({'margin-top':'-292px','opacity':'0'},800);
	});
	$('#j_captcha').bind('input propertychange', function() {
		$(".destroy").stop(true).animate({'margin-top':'-292px','opacity':'0'},800);
	});
	
});
function genTimestamp(){
	var time = new Date();
	return time.getTime();
}
function changeCode(){
	var j_randomKey = genTimestamp();
	$("#j_randomKey").val(j_randomKey);
	$("#captcha_img").attr("src", "captcha?t="+j_randomKey);
}
function choose_bg() {
	var bg = Math.floor(Math.random() * 9 + 1);
	$('body').css('background-image', 'url(${rootpath}/BJUI/images/loginbg_0'+ bg +'.jpg)');
}
</script>
<script type="text/javascript">
function tip(msg){
	$("#errormsg").text(msg);
	$(".destroy").stop(true).animate({'margin-top':'0px','opacity':'1'},400);
}
</script>
</head>
<body>
<!--[if lte IE 7]>
<style type="text/css">
#errorie {position: fixed; top: 0; z-index: 100000; height: 30px; background: #FCF8E3;}
#errorie div {width: 900px; margin: 0 auto; line-height: 30px; color: orange; font-size: 14px; text-align: center;}
#errorie div a {color: #459f79;font-size: 14px;}
#errorie div a:hover {text-decoration: underline;}
</style>
<div id="errorie"><div>您还在使用老掉牙的IE，请升级您的浏览器到 IE8以上版本 <a target="_blank" href="http://windows.microsoft.com/zh-cn/internet-explorer/ie-8-worldwide-languages">点击升级</a>&nbsp;&nbsp;强烈建议您更改换浏览器：<a href="http://down.tech.sina.com.cn/content/40975.html" target="_blank">谷歌 Chrome</a></div></div>
<![endif]-->
<div class="main_box">
    <div class="setting"><a href="javascript:;" onclick="choose_bg();" title="更换背景"><span class="glyphicon glyphicon-th-large"></span></a></div>
	<div class="login_box">
        <div class="login_logo">
            <img src="${rootpath}/BJUI/images/logo.png" >
        </div>
        <div class="login_form">
    		<form action="logincheck" id="login_form" method="post">
    			<input type="hidden" value="" id="j_randomKey"/>
    			<div class="form-group">
    				<label for="j_username" class="t">用户名：</label> <input id="j_username" value="" name="username" type="text" class="form-control x319 in" autocomplete="off">
    			</div>
    			<div class="form-group">
    				<label for="j_password" class="t">密　码：</label> <input id="j_password" value="" name="userpassword" type="password" class="form-control x319 in">
    			</div>
    			<div class="form-group">
    				<label for="j_captcha" class="t">验证码：</label> <input id="j_captcha" name="captcha" type="text" class="form-control x164 in" autocomplete="off">
    				<img id="captcha_img" alt="点击更换" title="点击更换" src="captcha" class="m">
    			</div>
    			<div class="form-group">
                    <label class="t"></label>
                    <label for="j_remember" class="m"><input id="j_remember" type="checkbox" value="true">&nbsp;记住我，以后自动登陆。</label>
    			</div>
    			<div class="form-group space">
                    <label class="t"></label>　　　
    				<input type="submit" id="login_ok" value="&nbsp;登&nbsp;录&nbsp;" class="btn btn-primary btn-lg">&nbsp;&nbsp;&nbsp;&nbsp;
    				<input type="reset" value="&nbsp;重&nbsp;置&nbsp;" class="btn btn-default btn-lg">
    			</div>
    			<div class="form-group space">
                    <label class="t"></label>
                    <label class="m">admin密码admin 其他用户密码123456</label>
    			</div>
    		</form>
        </div>
	</div>
	<div class="bottom">Copyright &copy; 2013 - 2015 <a href="" target="_blank">JfSnPM</a>
		<!-- 此处插入统计代码 -->
    	<script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_1253642392'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s11.cnzz.com/z_stat.php%3Fid%3D1253642392%26show%3Dpic' type='text/javascript'%3E%3C/script%3E"));</script>
		 
	</div>
</div>

<div class="destroy">
	<div class="sheet">
		<div class="head">
			<h2 id="errormsg">提示信息</h2>
		</div>
		<a class="close" title="关闭" href="#"></a>
	</div>
</div>

</body>
</html>